import http from "@/api";
// 定义响应数据的接口
interface ApiResponse {
  code: number;
  msg: string;
  data?: any; // 如果有其他数据字段，可以在这里定义
}
// 用户信息
export const Info = (): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/user/info",
    method: "get",
  });
};
// 邀请链接
export const InvitedCode = (): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/user/getInvitedCode",
    method: "get",
  });
};

// 资讯信息
// 资讯列表
export const AnnounceList = (params): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/api/getAnnounceList",
    method: "get",
    params,
  });
};
// 资讯详情
export const AnnounceDetail = (params): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/api/getAnnounceDetail",
    method: "get",
    params,
  });
};
// 我的推荐（团队）

export const team = (params): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/user/getTeam",
    method: "get",
    params,
  });
};

// 收益明细
export const RewardRecord = (params): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/user/getRewardRecord",
    method: "get",
    params,
  });
};

// 我的明细
export const AccountRecord = (params): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/user/getAccountRecord",
    method: "get",
    params,
  });
};

// 节点关系
export const TeamNode = (params): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/user/getTeamNode",
    method: "get",
    params,
  });
};

// 系统参数

export const Config = (): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/api/getConfig",
    method: "get",
  });
};

// 系统参数

export const Notice = (): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/api/getNotice",
    method: "get",
  });
};

// 商品图
export const GoodsThumb = (): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/goods/getGoodsThumb",
    method: "get",
  });
};
